import 'package:app/util/http.dart';
import 'package:flutter/material.dart';


class PickApi{

  BuildContext? context;

  static PickApi of(BuildContext? context) {
    PickApi pickApi = PickApi();
    pickApi.context = context;
    return pickApi;
  }

  ///  拣配完成
  Future<dynamic> finishPick(id) async{
    return ApiService.of(context).put('lgs/pick/finishPick', {'id': id});
  }

  /// 根据id查询拣配单
  Future<dynamic> pickById(id) async{
    return ApiService.of(context).get('lgs/pick/pickInfo/'+id);
  }

  /// 根据查询条件查询拣配单信息
  Future<dynamic> pickByFilter(String code, List<String> statusList,int size, int page) async{
    return ApiService.of(context).put('lgs/pick/pickInfo',
        {
          'code': code,
          'statusList': statusList,
          'current':page,
          'pageSize':size
        }
    );;
  }

  /// 根据拣配单id条件查询拣配详细信息
  Future<dynamic> pickDetailByPickId(String pickId) async{
    return ApiService.of(context).post('lgs/pick/pickDetailInfo',{
      'pickId':pickId
    });
  }

  /// 获取拣配单状态列表
  Future<dynamic> getTabFilters() async{
    return await ApiService.of(context).get('lgs/pick/statusFilters');
  }
}